<?php
/**
 * IG_Product_Notice
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: Area.php 929 2011-10-27 07:52:50Z mmxie $
 */
class IG_Product_Config_Area extends IG_Product_Config_Abstract
{
    protected $_groups = array();

    public function __construct($data = null)
    {
        parent::__construct($data);
        if (!isset($this->_data['children'])) return ;
        foreach ($this->_data['children'] as $item) {
            if (strpos($item['tags'], 'game-group') !== false) {
                $this->_groups[$item['name']] = new IG_Product_Config_Group($item);
            }
        }
    }

    /**
     * @return IG_Product_Config_Group
     */
    public function getGroup($name)
    {
        return isset($this->_groups[$name]) ? $this->_groups[$name] : null;
    }

    public function getGroups()
    {
        return $this->_groups;
    }
}